package com.didispace.sys.dao;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.JpaRepository;

import com.didispace.sys.entity.Icon;


/**
 * @author 程序猿DD
 * @version 1.0.0
 * @date 16/3/23 下午2:34.
 * @blog http://blog.didispace.com
 */
@CacheConfig(cacheNames = "icons")
public interface IconRepository extends JpaRepository<Icon, Long> {
	@Cacheable(key = "#p0")
    Icon findByType(String type);

    @CachePut(key = "#p0.type")
    Icon save(Icon icon);

}
